//oggetto inviato per la ricerca di un particolare servizio
package it.unibo.deis.lia.mmhc.sfm;

import it.unibo.deis.lia.mmhc.nip.NetworkInterfaceProvider;

import java.util.Vector;

public class SearchService extends MessageObject {

	private Vector<String> searchGoPath;
	private Vector<String> searchBackPath;

	private String richiedente;

	public SearchService(int hopToLive, Object ogg) {
		super(hopToLive, ogg);
		this.searchGoPath = new Vector<String>();
		this.searchBackPath = new Vector<String>();
		richiedente = NetworkInterfaceProvider.getMyUniversalName();
	}

	public SearchService(int hopToLive, Object ogg, String richiedente) {
		super(hopToLive, ogg);
		this.searchGoPath = new Vector<String>();
		this.searchBackPath = new Vector<String>();
		this.richiedente = richiedente;
	}

	public Vector<String> getSearchGoPath() {
		return searchGoPath;
	}

	public String getRichiedente() {
		return richiedente;
	}

	public void setRichiedente(String richiedente) {
		this.richiedente = richiedente;
	}

	public void setSearchGoPath(Vector<String> searchPath) {
		this.searchGoPath = searchPath;
	}

	public Vector<String> getSearchBackPath() {
		return searchBackPath;
	}

	public void setSearchBackPath(Vector<String> searchBackPath) {
		this.searchBackPath = searchBackPath;
	}

	public void addGoHop(String thisHop) {
		searchGoPath.add(thisHop);
	}

	public void addBackHop(String previusHop) {
		searchBackPath.add(0, previusHop);
	}

}
